import org.molamil.acto.pages.master.DependsProvider;

/**
 * @author Jorge Hernandez
 */
class org.molamil.acto.pages.master.DependsManager implements DependsProvider {
	
	
	//Properties
	
	private var depends:Array; 
	
	
	// Constructor
	
	public function DependsManager() {
		depends = new Array;
	}
	
	
	// Functions
	
	public function addDepends(name:String):Void {
		if (!existsDepends(name))
			depends.push(name);
	}

	public function removeDepends(name:String):Void {
		var a:Array = new Array();
		for (var i:Number = 0; i < depends.length; i++) {
			if (name != depends[i])
				a.push(depends[i]);
		}
		depends = a;
	}
	
	public function existsDepends(name:String):Boolean {
		var b:Boolean = false;
		for (var i : Number = 0; i < depends.length; i++) {
			if (name == depends[i]) {
				b = true;
				break;
			}
		}
		return b;
	}
	
	public function getDepends():Array {
		return depends;
	}
	
	
}
